<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org" >

<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script type="text/javascript" th:src="@{/jquery-2.1.4.min.js}"></script>
<script type="text/javascript" th:src="@{/bootstrap-3.3.7-dist/js/bootstrap.min.js}"></script>
<link type="text/css" rel="stylesheet" th:href="@{/bootstrap-3.3.7-dist/css/bootstrap.min.css}">
<script type="text/javascript" th:src="@{/bootstrap-treeview/bootstrap-treeview.min.js}"></script>
<link type="text/css" rel="stylesheet" th:href="@{/bootstrap-treeview/bootstrap-treeview.min.css}">
<script type="text/javascript" th:src="@{/bootStrap-addTabs/bootstrap.addtabs.min.js}"></script>
<link type="text/css" rel="stylesheet" th:href="@{/bootStrap-addTabs/bootstrap.addtabs.css}">
<script type="text/javascript" th:src="@{/bootstrap-table/bootstrap-table.min.js}"></script>
<script type="text/javascript" th:src="@{/bootstrap-table/locale/bootstrap-table-zh-CN.min.js}"></script>
<link type="text/css" rel="stylesheet" th:href="@{/bootstrap-table/bootstrap-table.min.css}">

<script type="text/javascript" th:src="@{/bootstrap-fileinput/js/fileinput.min.js}"></script>
<script th:src="@{/bootstrap-fileinput/js/locales/zh.js}"></script>
<body>

<table id="MyTableId" ></table>

</body>
<script>

    $(function (){
        queryType();
    })

    queryType = function (){
        $("#MyTableId").bootstrapTable({
            url:"Sq/getaddupList",
            columns:[
                {field: "integral_number", title:"单据号"},
                {field: "integral_title", title:"积分标题"},
                {field: "integral_addup", title:"积分"},
                {field: "integral_PribukObjct", title:"奖扣对象"},
                {field: "integral_auditor", title:"审核人"},
                {field: "integral_state", title:"状态",
                    formatter:function(value,row){
                        if (value==1){
                            return "待审核"
                        }
                        if (value==2){
                            return "已审核"
                        }
                    }},
                {field: "tool", title:"操作",formatter:function(value,row){
                        var str='<button class="btn btn-info" onclick="del('+row.intid+')">撤销</button>';
                        return str;
                }},
            ],
            pagination:true,
            pageSize:10,
            pageList:[2,4,6,8,10],
            sidePagination: "client"
        })
    }

    del=function (id){
        $.ajax({
            url:"Sq/del",
            data:{id:id},
            success:function(){
                $("#MyTableId").bootstrapTable('refresh');
            }
        })
    }

</script>
</html>